package com.trio.zjq.dao.impl;

import com.trio.zjq.dao.BookInfoDao;
import com.trio.zjq.entity.BookInfo;
import com.trio.zjq.utils.MyBatisUtils;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

/**
 * @author 未绪.
 * @desc ${DESCRIPTION}.
 * @date 2017/11/22-10:08.
 */
public class BookInfoDaoImpl implements BookInfoDao{

    public List<BookInfo> findBookListByUserInfo(int userId) {
        SqlSession session = MyBatisUtils.getSession();

        List<BookInfo> bookInfoList = session.selectList("mapperings.BookInfoMapper.findBookListByUserInfo",userId);

        session.commit();
        session.close();

        return bookInfoList;
    }
}
